import sys, os 
abspath = os.path.dirname(__file__) 
sys.path.append(abspath) 
os.chdir(abspath) 

import web
from web.contrib.template import render_jinja
import admin

urls=(
        '/','index',
        '/admin',admin.app,
        '/hello','hello',
        )
                
web.config.debug = False
        
render=render_jinja(
        'templates/default',
        encoding='utf-8',
)       

app = web.application(urls, globals())
application = app.wsgifunc()

session = web.session.Session(app, web.session.DiskStore('sessions'),initializer ={'login':0})
if('_session' not in web.config):
	web.config._session = session
        
class index:
        def GET(self):
                web.header('Content-Type','text/html; charset=UTF-8')
                return render.index()
class hello:
        def GET(self):
                web.header('Content-Type','text/html; charset=UTF-8')
                return 'hello!!'
                
if __name__=="__main__":
        app.run()     	
